<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div th:replace="common/top"></div>

<div id="BackLink">
    <a href="/catalog/view">Return to Main Menu</a>
</div>

<div id="Catalog">

    <h2>All categories are below</h2>
<!--    todo:搜索category-->
    <form action="/catalogM/viewCategory" style="margin: 10px">
        请输入关键字:<input type="text" name="str" style="margin: 10px"><button type="submit" style="margin: 10px; background: linear-gradient(
            50deg,#9cbd29, #298811)">搜索</button>
    </form>
    <table>
        <tr>
            <th>Catid</th>
            <th>Name</th>
            <th>modify</th>
            <th>delete</th>
        </tr>

        <tr th:each="category:${categoryList}">
            <td>
                <a th:href="@{/catalogM/viewProduct(categoryId=${category.categoryId})}"  th:text="${category.categoryId}" >categoryId</a>
            </td>
            <td th:text="${category.name}">categoryName</td>
            <td><a th:href="@{/catalogM/gotoModifyCategory(categoryId=${category.categoryId})}">修改</a></td>

            <td><a th:href="@{/catalogM/deleteCategory(categoryId=${category.categoryId})}">删除</a></td>
        </tr>
        <tr>
            <td colspan="4" style="text-align: center" > <a href="/catalogM/gotoAddCategory" >新增</a> </td>
        </tr>

    </table>
</div>


<div th:replace="common/bottom"></div>


</body>
</html>